// eslint-disable-next-line @typescript-eslint/no-unused-vars

class Logger {
  private static instance: Logger | null = null;
  private logger: any;

  private constructor() {}

  private async initialize() {
    try {
      const log = require("electron-log/main")
      log.initialize();
      this.logger = log;
    } catch (error) {
      console.error("Failed to initialize logger:", error);
      this.logger = null;
    }
  }

  static getInstance(): Logger {
    if (Logger.instance === null) {
      Logger.instance = new Logger();
      Logger.instance.initialize();
    }
    return Logger.instance;
  }

  info(message: string): void {
    this.logger?.info(message);
  }

  warn(message: string): void {
    this.logger?.warn(message);
  }

  error(message: string): void {
    this.logger?.error(message);
  }

  debug(arg): void {
    console.debug(arg)
    this.logger?.debug(arg);
  }
}

export default Logger
